import { RouteObject } from "react-router-dom";
import create from "zustand";

// element 为字符串
export interface MyRouteObject extends RouteObject {
  element?: string;
  name?: string;
  children?: MyRouteObject[];
}

export type Menus = undefined | MyRouteObject[];

interface CommonStore {
  menus: Menus; // 菜单数据
  setMenus: (menus: Menus) => void; // 修改菜单数据的方法
}

export default create<CommonStore>((set) => ({
  menus: undefined,
  setMenus: (menus) => set({ menus }),
}));
